}
void
-gtk_snapshot_init (GtkSnapshot *state,
- GskRenderer *renderer)
+gtk_snapshot_init (GtkSnapshot *snapshot,
+ GskRenderer *renderer,
+ const cairo_region_t *clip)
{
- state->state = NULL;
- state->root = NULL;
- state->renderer = renderer;
+ snapshot->state = NULL;
+ snapshot->root = NULL;
+ snapshot->renderer = renderer;
+ snapshot->clip_region = clip;
}
GskRenderNode *
GskRenderNode *root;
GskRenderer *renderer;
+ const cairo_region_t *clip_region;
};
void gtk_snapshot_init (GtkSnapshot *state,
- GskRenderer *renderer);
+ GskRenderer *renderer,
+ const cairo_region_t *clip);
GskRenderNode * gtk_snapshot_finish (GtkSnapshot *state);
static inline const graphene_matrix_t *
GtkSnapshot snapshot;
GskRenderer *fallback;
graphene_rect_t viewport;
+ cairo_region_t *clip;
GskRenderNode *node;
graphene_rect_init (&viewport,
widget->priv->allocation.y - widget->priv->clip.y,
widget->priv->clip.width,
widget->priv->clip.height);
+ clip = cairo_region_create_rectangle (&(cairo_rectangle_int_t) {
+ widget->priv->allocation.x - widget->priv->clip.x,
+ widget->priv->allocation.y - widget->priv->clip.y,
+ widget->priv->clip.width,
+ widget->priv->clip.height});
fallback = gsk_renderer_create_fallback (renderer, &viewport, cr);
- gtk_snapshot_init (&snapshot, renderer);
+ gtk_snapshot_init (&snapshot, renderer, clip);
gtk_widget_snapshot (widget, &snapshot);
node = gtk_snapshot_finish (&snapshot);
if (node != NULL)
gsk_render_node_unref (node);
}
+ cairo_region_destroy (clip);
g_object_unref (fallback);
}
else
if (renderer == NULL)
return;
- gtk_snapshot_init (&snapshot, renderer);
+ gtk_snapshot_init (&snapshot, renderer, region);
gtk_widget_snapshot (widget, &snapshot);
root = gtk_snapshot_finish (&snapshot);
if (root == NULL)